package net.maku.other.service.impl;

import cn.hutool.core.bean.BeanUtil;
import net.maku.framework.mybatis.service.impl.BaseServiceImpl;
import net.maku.framework.security.user.SecurityUser;
import net.maku.other.dao.ChairmanMailboxDao;
import net.maku.other.model.ChairmanMailboxEntity;
import net.maku.other.service.ChairmanMailboxService;
import net.maku.other.vo.AddChairmanMailboxVO;
import org.springframework.stereotype.Service;

/**
 * @Author: qr
 * @Date: 2025/3/27 23:42
 * @Version 1.0
 */
@Service
public class ChairmanMailboxServiceImpl extends BaseServiceImpl<ChairmanMailboxDao, ChairmanMailboxEntity> implements ChairmanMailboxService {


    @Override
    public void apply(AddChairmanMailboxVO mailboxVO) {
        ChairmanMailboxEntity entity = BeanUtil.copyProperties(mailboxVO, ChairmanMailboxEntity.class);
        entity.setUserId(SecurityUser.getUserId());
        entity.setOrgId(SecurityUser.getUser().getOrgId());
        this.save(entity);
    }
}
